<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        let a = 1
        while (a<=100){
            a++
            console.log("a:",a)
        }
        for (let index =0;index< 101;index++){
            console.log("index is:",index)
        }
        let myArray = [1,2,3,4]
        for(let index = 0;index< myArray.length;index++){
            console.log("当前数据：",myArray[index])
        }
        // 打印对象数据
        let myObject = {
            name: "yangxu",
            age: 18,
            QQ: "110110"
        }
        //for in
        for (let key in myObject){
            console.log(key + ":" + myObject[key])
        }
        //
        for (let [key,value] of Object.entries(myObject)){
            console.log(key + ": " + value)
        }
        //forEach
        let myArray2 = [6,7,8]
        myArray2.forEach(function (value) {
            console.log(value)
        })
    </script>

</head>
<body>

</body>
</html>